
package com.itheima.fangfa;

import java.util.Scanner;

public class test2 {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        System.out.println("请输入第一个整数：");
        int a=sc.nextInt();
        System.out.println("请输入第二个整数：");
        int b=sc.nextInt();
        System.out.println("请输入第三个整数：");
        int c=sc.nextInt();
        int arr[]={a,b,c};
        int[] te=method(arr);
        System.out.println("从大到小的顺序是："+te[0]+" "+te[1]+" "+te[2]);
    }
    public static int[] method(int arr[]){
        int max=arr[0];
        int min=arr[0];
        int sum=0;
        sum = arr[0]+arr[1]+arr[2];
        for (int i=1;i< arr.length;i++){
            if (max<arr[i]){
                max=arr[i];
            }else if(min>arr[i]){
                min=arr[i];
            }
        }
        int mid=sum-max-min;
        int[] te={max,mid,min,sum};
        return te;
    }
}
